<a href="<?php echo $config['url'] ?>extend/rss/?what=discussion">RSS &raquo;</a>
<table width="100%" border="1">
  <tr><th>Page</th><th>Name</th><th>IP</th><th>Time</th><th>comment</th></tr>
<?php
// pagination?
$comments = sqlite_fetch_all(sqlite_query($db,"SELECT * FROM comments ORDER BY time DESC"));
for($i=0; $i<50; $i++) {
  $comment = $comments[$i];
  if(isset($comment)) {
    $title = sqlite_fetch_single(sqlite_query($db,"SELECT name FROM pages WHERE id = ".$comment['pageid'])); ?>
    <tr>
      <td><?php echo getLink('show',$title) ?></td>
      <td><?php echo $comment['name'] ?></td>
      <td><?php echo iplink($comment['IP']) ?></td>
      <td><?php echo timeDiff($comment['time']) ?></td>
      <td><?php echo textilize(parselinks($comment['body'])) ?></td>
    </tr>
<?php 
  }
}
?>
</table>